package com.example.administrator.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;

import com.example.administrator.myapplication.uilts.ChengshiAdapter;

/**
 * Created by 董豪华 on 2017/1/5.
 */
public class Didian extends AppCompatActivity {
    GridView gv_chenshi;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        final ChengshiAdapter adapter = new ChengshiAdapter(Didian.this);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.acitivity_chengshi);
        gv_chenshi = (GridView) findViewById(R.id.gv_chenshi);
        gv_chenshi.setAdapter(adapter);
        gv_chenshi.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String s = adapter.getCity()[position];
                Intent intent = new Intent(Didian.this, ZhuJianMian.class);
                intent.putExtra("city",s);
                startActivity(intent);
                finish();
            }
        });

    }
    public void fanhuizhu(View view){
        Intent intent = new Intent(Didian.this, ZhuJianMian.class);
        startActivity(intent);
        finish();
    }
}
